library(leaflet)
library(rmarkdown)

Data

The data for this work is hospital data provided by National Land Numerical Information Download Service which covers all hospitals in Japan.As the number of the hospials in Japan is too many to plot, I narrowed the data into those in Kanagawa Prefecture.

setwd("C:/Users/Tachibana/Documents/GitHub/Developing_Data_Products")
data<-read.csv("JPNHopsKanagawaOnly.csv")
names(data)
##  [1] "ns3.id"                                     
##  [2] "ns3.description"                            
##  [3] "srsName"                                    
##  [4] "frame"                                      
##  [5] "ns3.lowerCorner"                            
##  [6] "ns3.upperCorner"                            
##  [7] "ns3.beginPosition"                          
##  [8] "calendarEraName"                            
##  [9] "indeterminatePosition"                      
## [10] "ns3.id2"                                    
## [11] "ns3.pos"                                    
## [12] "ns3.id3"                                    
## [13] "ns2.href"                                   
## [14] "ns1.medicalInstitutionClassification"       
## [15] "ns1.medicalInstitutionName"                 
## [16] "ns1.address"                                
## [17] "ns1.address2"                               
## [18] "ns1.address3"                               
## [19] "ns1.diagnosisAndTreatmentSubject1"          
## [20] "ns1.diagnosisAndTreatmentSubject2"          
## [21] "ns1.establishmentOrganizationClassification"
## [22] "ns1.diagnosisAndTreatmentSubject3"
HospLatLong<-data.frame(lat=data[-1,17],lng=data[-1,18])

HospLatLong %>% 
  leaflet() %>%
  addTiles() %>%
  addCircleMarkers()